package main
import ("fmt")

func main(){

	nums := []int{1,2,3}
	sum := 0
	for _,num := range nums{
		sum += num
	}
	fmt.Println("sum:",sum)

	for index,num := range nums{
		if num == 2{
			fmt.Println("index of 2:",index)
		}
	}

	m := map[string] string{
		"alan":"me",
		"noc":"him",
	}
	for k,v := range m{
		fmt.Println(k,v)
	}

	for k := range m{
		fmt.Println(k)
	}

	for i,c := range "alan"{
		fmt.Printf("index-char: %d-%c \n",i,c)
	}




}